import store from '@/store'
import { dateFormat } from '@/util/date';
export const startDate = dateFormat(new Date(), 'yyyy-MM-') + '01 00:00:00';
export const endDate = dateFormat(new Date(), 'yyyy-MM-dd') + ' 00:00:00';
export const tableOption = {
  "border": true,
  "stripe": true,
  "menuAlign": "center",
  "index": true,
  "indexLabel": "序号",
  "align": "center",
  "searchMenuSpan": 6,
  addBtn: false,
  viewBtn: true,
  delBtn: false,
  selection: true,
  height: 450,
  "column": [{
      "prop": "id",
      "type": "input",
      "label": "唯一标识",
      "hide": true,
      "display": false
    }, {
      "prop": "lineCode",
      "type": "input",
      "label": "线路编码",
      "hide": true,
      "display": false
    }, {
      "prop": "stationCode",
      "type": "input",
      "label": "车站编码",
      "hide": true,
      "display": false
    }, {
      label: '票种',
      prop: 'ticketType',
      search: true,
      type: 'select',
      dicUrl: '/support/swpmticketcardtype/dict',
      props: {
        label: 'mainName',
        value: 'mainEnName'
      },
      cascaderItem: ["ticketName"],
      rules: [{
        required: true,
        message: '请选择票种',
        trigger: 'blur'
      }],
      cell: true
    }, {
      label: '车票名称',
      prop: 'ticketName',
      search: true,
      type: 'select',
      props: {
        label: 'subName',
        value: 'subEnName'
      },
      dicUrl: '/support/swpmticketcardtypeparam/dictAll/{{key}}',
      dicFlag: false,
      rules: [{
        required: true,
        message: '请选择车票名称',
        trigger: 'blur'
      }],
      cell: true,
      component: 'ticket-name-select',
      params: {
        ticketAmountKey: 'ticketAmount',
        ticketCountKey: 'ticketCount'
      }
    }, {
      label: '金额',
      prop: 'ticketAmount',
      "type": "number",
      "precision": 2
    }, {
      label: '次数',
      prop: 'ticketCount',
      "type": "number"
    }, {
      label: '回收数量',
      prop: 'recoverNumber',
      type: 'number',
      rules: [{
        required: true,
        message: '请输入回收数量'
      }],
      cell: true,
    }, {
      "label": "回收时间",
      "prop": "recoverTime",
      "type": "date",
      "format": "yyyy-MM-dd",
      "valueFormat": "yyyy-MM-dd HH:mm:ss",
      search: true,
      searchValue: [startDate, endDate],
      searchSpan: 12,
      searchRange: true,
      cell: true,
      rules: [{
        required: true,
        message: '请选择回收时间'
      }]
    }, {
      label: '回收人',
      prop: 'recoverPersonName',
      type: 'select',
      search: 'true',
      rules: [{
        required: true,
        message: '请选择回收人'
      }],
      component: 'user-select',
      params: {
        userCodeKey: 'recoverPersonCode',
        belongToStation: true
      }
    }, {
      label: '回收人工号',
      prop: 'recoverPersonCode',
      disabled: true
    }, {
      "prop": "remark",
      "span": 24,
      "type": "textarea",
      "label": "备注",
      "hide": true,
      "display": true
    }, {
      "prop": "creatorId",
      "type": "input",
      "label": "创建人ID",
      "hide": true,
      "display": false
    }, {
      "prop": "creatorName",
      "type": "input",
      "label": "创建人名称",
      "hide": true,
      "display": false
    }, {
      "prop": "createTime",
      "type": "input",
      "label": "创建时间",
      "hide": true,
      "display": false,
    }, {
      "prop": "updateTime",
      "type": "input",
      "label": "更新时间",
      "hide": true,
      "display": false
    }
  ]
}

export const tableOptionAdd = {
  "border": true,
  "stripe": true,
  "menuAlign": "center",
  "index": true,
  "indexLabel": "序号",
  "align": "center",
  "searchMenuSpan": 6,
  addBtn: false,
  viewBtn: true,
  delBtn: false,
  selection: true,
  height: 450,
  "column": [{
      "prop": "id",
      "type": "input",
      "label": "唯一标识",
      "hide": true,
      "display": false
    }, {
      "prop": "lineCode",
      "type": "input",
      "label": "线路编码",
      "hide": true,
      "display": false
    }, {
      "prop": "stationCode",
      "type": "input",
      "label": "车站编码",
      "hide": true,
      "display": false
    }, {
      label: '票种',
      prop: 'ticketType',
      search: true,
      type: 'select',
      dicUrl: '/support/swpmticketcardtype/dict',
      props: {
        label: 'mainName',
        value: 'mainEnName'
      },
      cascaderItem: ["ticketName"],
      rules: [{
        required: true,
        message: '请选择票种',
        trigger: 'blur'
      }],
      width: 130,
      cell: true
    }, {
      label: '车票名称',
      prop: 'ticketName',
      search: true,
      type: 'select',
      props: {
        label: 'subName',
        value: 'subEnName'
      },
      dicUrl: '/support/swpmticketcardtypeparam/dictAll/{{key}}',
      dicFlag: false,
      rules: [{
        required: true,
        message: '请选择车票名称',
        trigger: 'blur'
      }],
      width: 170,
      cell: true,
      component: 'ticket-name-select',
      params: {
        ticketAmountKey: 'ticketAmount',
        ticketCountKey: 'ticketCount'
      }
    }, {
      label: '金额',
      prop: 'ticketAmount',
      "type": "number",
      "precision": 2
    }, {
      label: '次数',
      prop: 'ticketCount',
      "type": "number"
    }, {
      label: '回收数量',
      prop: 'recoverNumber',
      type: 'number',
      rules: [{
        required: true,
        message: '请输入回收数量'
      }],
      width: 130,
      cell: true,
    }, {
      "label": "回收时间",
      "prop": "recoverTime",
      "type": "date",
      "format": "yyyy-MM-dd",
      "valueFormat": "yyyy-MM-dd HH:mm:ss",
      search: true,
      searchSpan: 12,
      searchRange: true,
      width: 200,
      cell: true,
      rules: [{
        required: true,
        message: '请选择回收时间'
      }]
    }, {
      label: '回收人',
      prop: 'recoverPersonName',
      type: 'select',
      search: 'true',
      rules: [{
        required: true,
        message: '请选择回收人'
      }],
      component: 'user-select',
      params: {
        userCodeKey: 'recoverPersonCode',
        belongToStation: true
      },
      width: 150
    }, {
      label: '回收人工号',
      prop: 'recoverPersonCode',
      disabled: true
    }, {
      "prop": "remark",
      "type": "input",
      "label": "备注",
      width: 250,
      cell: true
    }, {
      "prop": "creatorId",
      "type": "input",
      "label": "创建人ID",
      "hide": true,
      "display": false
    }, {
      "prop": "creatorName",
      "type": "input",
      "label": "创建人名称",
      "hide": true,
      "display": false
    }, {
      "prop": "createTime",
      "type": "input",
      "label": "创建时间",
      "hide": true,
      "display": false,
    }, {
      "prop": "updateTime",
      "type": "input",
      "label": "更新时间",
      "hide": true,
      "display": false
    }
  ]
}